home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 4 / CDPD_IV.bin / e / mailinglists / amigae.0294feb.archive / 000009_donews!crash!fr…leton.ca!ao443_Fri, 4 Feb 94 01:40:03 PST.msg < prev    next >
Internet Message Format  |  1994-05-26  |  2KB

  1. Received: by bkhouse.cts.com (V1.17-beta/Amiga)
  2.       id <1q2u@bkhouse.cts.com>; Fri, 4 Feb 94 01:40:03 PST
  3. Received: from crash by donews.cts.com with uucp
  4.     (Smail3.1.28.1 #18) id m0pSDz8-0001OnC; Thu, 3 Feb 94 19:01 EST
  5. Received: from freenet-news.carleton.ca by crash.cts.com with smtp
  6.     (Smail3.1.28.1 #18) id m0pSDv7-0000ajC; Thu, 3 Feb 94 15:57 PST
  7. Received: from freenet.carleton.ca by freenet-news.carleton.ca (4.1/SMI-4.0)
  8.     id AA27308; Thu, 3 Feb 94 18:57:29 EST
  9. Received: from localhost (ao443@localhost) by freenet.carleton.ca (8.6.4/8.6.4) id SAA24368; Thu, 3 Feb 1994 18:56:58 -0500
  10. Date: Thu, 3 Feb 1994 18:56:58 -0500
  11. Message-Id: <199402032356.SAA24368@freenet.carleton.ca>
  12. Reply-To: ao443@freenet.carleton.ca
  13. From: ao443@freenet.carleton.ca (Jason Maskell)
  14. To: amigae@bkhouse.cts.com
  15. Subject: Disk info (as requested)
  16.  
  17.  
  18.     Rob Nottage asked for help on this, so here's the writeup on how to
  19. get volume names, sizes, etc... (Modified for beginners as well, as I know
  20. you aren't, Rob.)
  21.  
  22.     Ok, first of all, to figure out whether a device is useable in a
  23. dir utility, use the function IsFileSystem(name). So
  24.     IF IsFileSystem('PAR:')
  25.         ...
  26.     ENDIF
  27.     The other thing you need to know about is the InfoData structure,
  28. and the Info() command. InfoData is the following and must be longword
  29. aligned. (Which I'm sure is probably taken care of in E, if you allocate it
  30. in your DEF.)
  31.  
  32. OBJECT InfoData
  33.     numsofterrors:LONG
  34.     unitnumber:LONG
  35.     diskstate:LONG
  36.     numblocks:LONG        /* So, these three are how you */
  37.     numblocksused:LONG    /* Compute size remaining, of course. */
  38.     bytesperblock:LONG
  39.     disktype:LONG
  40.     volumenode:LONG        /*<- This is a BCPL pointer to a node */
  41.     inuse:LONG        /* So, to use it as an E ptr, you must */
  42. ENDOBJECT            /* ptr:=Shl(ptr,2) (I believe.) */
  43.  
  44.  
  45.     To get this structure, use the Dos call Info(lock,infodata). Where
  46. lock is a BCPL pointer to a lock (obtained from Open or Lock), and infodata
  47. is a pointer to an allocated InfoData structure. This way you can use any
  48. open file to obtain the volume information.
  49.     That should pretty much do it. If example code is needed, I'll be
  50. happy to post it.
  51.  
  52.  
  53.  
  54. --
  55. 'You see son, if this were Star Trek, we'd be negotiating with this Kobold.'
  56. - Unknown Angband Player